#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author   : BUZAI
# @Time     : 2021/7/17 11:03
import requests
from lib.token_bubu import token_bubu

class DeleteMember():
    def delete_members(self,name):
        '''删除会员'''
        urll='http://hn216.api.yesapi.cn/'
        payload = {'s': 'App.User.Search',"app_key": "C876FB282276FFB18692EDB8994BC330",'username': name}
        res=requests.post(url=urll, json=payload)
        ress=res.json()
        print(ress)
        self.uuidd=ress['data']['users'][0]['uuid']


    def delete_memberss(self):
        token = token_bubu()
        url='http://hn216.api.yesapi.cn/'
        payload={'s':'App.User.RemoveUserForAdmin','app_key':'C876FB282276FFB18692EDB8994BC330','other_uuid':self.uuidd,'admin_uuid':'BA56939707F8AC3FD126F16536BB309D','admin_token':token}
        requests.post(url=url,json=payload)

    def deme(self,name):
        self.delete_members(name)
        self.delete_memberss()